package com.yunquan.ohana.view

import android.content.Context
import android.util.AttributeSet
import android.view.MotionEvent
import android.view.Surface
import com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer


/**
 * 带封面
 * Created by guoshuyu on 2017/9/3.
 */
class SampleCoverVideo : StandardGSYVideoPlayer {

    constructor(context: Context?, fullFlag: Boolean?) : super(context, fullFlag)

    constructor(context: Context?) : super(context)

    constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs)

    override fun init(context: Context?) {
        super.init(context)
//        mStartButton?.visibility = View.GONE
//        mStartButton = null
//        mLoadingProgressBar = null
    }

    val currentSurface: Surface
        get() = mSurface

    private var mListener: OnTapListener? = null

    override fun onClickUiToggle(e: MotionEvent?) {
//        super.onClickUiToggle(e)
        mListener?.onTap()
    }

    fun setOnTap(listener: OnTapListener) {
        this.mListener = listener
    }

    interface OnTapListener {
        fun onTap()
    }
}